package com.vortex.cloud.sample.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.google.common.collect.Lists;
import com.vortex.cloud.vfs.lite.base.dto.excel.AbstractTemplateDTO;
import lombok.Data;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author 王林
 * @version 1.0
 * @date 2021-10-15 周五
 * @time 14:38
 * @description
 */
@Data
public class ExcelMessageTaskUserInfoDTO implements AbstractTemplateDTO {
    /**
     * 物理id
     */
//    @ExcelProperty(value = "序号")
////    private Integer id;

    @ExcelProperty(value = "用户ID")
    private String userId;

    @ExcelProperty(value = "用户名")
    private String name;

    @ExcelProperty(value = "邮箱")
    private String email;

    @ExcelProperty(value = "性别")
    private String gender;

    @ExcelProperty(value = "积分")
    private Integer score;

    @ExcelProperty(value = "IP")
    private String ip;

    @ExcelProperty(value = "登入次数")
    private Integer count;

    @ExcelProperty(value = "加入时间")
    private String startDate;

    @Override
    public List<String> listFieldNames() {
        Class<? extends ExcelMessageTaskUserInfoDTO> aClass = this.getClass();
        Field[] declaredFields = aClass.getDeclaredFields();
        ArrayList<String> arrayList = new ArrayList<>();
        for (Field declaredField : declaredFields) {
            arrayList.add(declaredField.getName());
        }
        return arrayList;
//        return Lists.newArrayList("userId", "name", "email", "gender", "score", "ip", "count", "date");
    }
}

